<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let xhr = new XMLHttpRequest();
        let url = `http://newshopapi.0melon0.cn/api/f_user/register`;
        let data = "name=都是&phone=15423242322&card=231311313131341";
        xhr.open('POST', url);
        // 设置请求体格式
        xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xhr.send(data);
        xhr.addEventListener('readystatechange', function() {
            if (xhr.readyState == 4) {
                if (xhr.status == 200) {
                    let res = JSON.parse(xhr.responseText);
                    console.log(res);
                }
            }
        })

        // var arr = [1, 2, 3, 4]
        // console.log(arr.slice(0, arr.length - 1));
    </script>
</body>

</html>